// Description:
// 
// Count the number of prime numbers less than a non-negative number, n.
// 
// Credits:
// Special thanks to @mithmatt for adding this problem and creating all test cases.


class Solution {
public:
    int countPrimes(int n)
    {
        int cout = 0;
		for(int i = 3 ; i <= n ; i = i+2 )
		{
			if(isPrime(i))
			{
				cout = cout + i;
			}
		}
    }
    
    bool isPrime(int n)
    {
        int i = sqrt(n);
		for(int j = 3 ; j <= i  ; j = j + 2 )
		{
			if(n % j == 0)
			{
				return true;
			}
			
			return false;
		}
    }
};